import request from "@/utils/request";

class AuthAPI {

	//获取用户列表
	static getSessionList(AuthorizeCode: string, data: any) {
		// console.log('data.invalid', data.invalid);
        // console.log('data',data);
		let formobj={
			page:data.page,
			page_size:data.page_size,
			search:data.search,
			invalid:data.invalid,
			query_params:data.query_params,
		}
		return request<any>({
		  url: `/session/page-list`,
		  method: "post",
		  data:formobj,
		  headers: {
			token: AuthorizeCode,
		  },
		});
	  }

	//获取对话详情
	static getSessionInfo(AuthorizeCode: string, data: any) {
        
		let formobj={
			page:data.page,
			page_size:data.page_size,
			session_id:data.session_id,
			session_code:data.session_code
		}
		if (formobj.session_id=='') {
			delete 	formobj.session_id
		}
		if (formobj.session_code=='') {
			delete 	formobj.session_code
		}
		return request<any>({
		  url: `/session/page-list-in-session`,
		  method: "get",
		  params:formobj,
		  headers: {
			token: AuthorizeCode,
		  },
		});
	  };
	//获取删除对话
	static getDelsete(AuthorizeCode: string, data: any) {
		return request<any>({
		  url: `/session/delete`,
		  method: "post",
		  data:data.session_id,
		  headers: {
			token: AuthorizeCode,
			"Content-Type":"multipart/form-data"
		  },
		});
	};
}
export default AuthAPI;

